package com.waste.game.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.waste.game.entity.entitiytv.VideoPlBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Transactional(rollbackFor = RuntimeException.class)
public interface VideoPlDao extends BaseMapper<VideoPlBean> {
    //评论查询
//    @Select("SELECT * FROM videopl WHERE parent_id = 0 AND act_id = #{id} ORDER BY time DESC LIMIT #{num},#{num2}")
    List<VideoPlBean> getVideoPl(@Param("num") int num, @Param("num2") int num2, @Param("id") int id);
    //查询二级评论
//    @Select("SELECT * FROM videopl WHERE root_id = #{num} LIMIT 3")
    List<VideoPlBean> getPl2(@Param("num") int num);
    //查询回复条数
//    @Select("SELECT COUNT(*) FROM videopl WHERE root_id = #{num}")
    Long getHFNum(@Param("num") int num);
    //查询评论总条数
//    @Select("SELECT COUNT(*) FROM videopl WHERE act_id = #{id}")
    long getPlNum(@Param("id") int id);
}
